<!-- index.html -->  
$def with (posts, login_form)  
<h1>Blog posts</h1>  
$if not cookie().get('username'):  
    <form action="" method="post">  
    $:login_form.render()
    </form>  
$else:  
    Welcome $cookie().get('username')!<a href="/logout">Logout</a>  
<ul>  
    $for post in posts:  
        <li>  
            <a href="/view/$post.id">$post.title</a>  
            on $post.posted_on  
            $if cookie().get('username'):  
                <a href="/edit/$post.id">Edit</a>  
                <a href="/delete/$post.id">Del</a>  
        </li>  
</ul>  
